The examples/doc/bridges directory includes three object definition files that inherit from the three types of drawable objects: IDLgrWindow, IDLitDirectWindow and IDLitWindow. The following example uses the Export Bridge Assistant to create ActiveX controls from these object definition files and then creates a Windows application in Visual Basic .NET that includes the three controls.
The object definition files, idlgrwindowexample__define.pro, idlitdirectwindowexample__define.pro, and idlitwindowexample__define.pro are located in the
examples/doc/bridges subdirectory of the IDL distribution.
Open the Export Bridge Assistant by entering IDLEXBR_ASSISTANT at the IDL command line and then complete the following steps to export the three drawable objects.
Note: Export Bridge Assistant details are available in Specifying Information for Exporting. Refer to that section if you need more information about the following items.
The object defined in idlitdirectwindowexample__define.pro inherits from IDLitDirectWindow and creates a drawing canvas that you can write on using your mouse.
idlitdirectwindowexample__define.pro from the examples/doc/bridges directory, and click Open.|
Tree View Item |
Property Configuration |
|---|---|
|
IDL Export Bridge Project |
Accept the default value or make changes as desired:
|
|
idlitdirectwindowexample |
Drawable object equals True |
|
WINDOW_INDEX property |
You do not need to export the WINDOW_INDEX property as the control will always know it’s own index number. You can leave all fields unchanged. |
|
MAKECURRENT method |
Export — False. This is only used within methods in the IDL source object definition file. |
.tlb and .ocx files (named based on the object name) are created in the Output directory.The object defined in idlgrwindowexample__define.pro inherits from IDLgrWindow and displays a globe that can be rotated using your mouse.
idlgrwindowexample__define.pro from the examples/doc/bridges directory, and click Open.|
Tree View Item |
Property Configuration |
|---|---|
|
IDL Export Bridge Project |
Accept the default value or make changes as desired:
|
|
idlgrwindowexample |
Drawable object equals True |
|
CREATEOBJECTS method |
Export — False. This method is not called from the COM client. |
.tlb and .ocx files (named based on the object name) are created in the Output directory.The object defined in idlitwindowexample__define.pro inherits from IDLitWindow and displays a surface in a view in which you can pan and zoom.
idlitwindowexample__define.pro from the examples/doc/bridges directory, and click Open.| Tree View Item | Property Configuration |
|---|---|
| IDL Export Bridge Project |
Accept the default value or make changes as desired:
|
| idlitwindowexample |
Drawable object equals True |
.tlb and .ocx files (named based on the object name) are created in the Output directory..ocx files generated by the Export Bridge Assistant using regsvr32 (see COM Registration Requirements for details if needed). If you kept the default names, you will need to register idlgrwindowexample.ocx, idlitdirectwindowexample.ocx, and idlitwindowexample.ocx.idlgrwindowexample Class, idlitdirectwindowexample Class, and idlitwindowexample Class files to the toolbox. Select View > Toolbox and select the desired tab. Right-click and select Add/Remove Items. Select the COM Components tab, place a checkmark next to the class files, and click OK.idlgrwindowexample Class, idlitdirectwindowexample Class and idlitwindowexample Class from left to right.
Note: The text file for this example, com_export_triwindow_doc.txt, is located in the examples/doc/bridges/COM subdirectory of the IDL distribution. This Visual Basic .NET code can be copied from the text file and adopted for use in your COM environment.
When you build and run the example, the output will appear similar to the following figure.
Left-click and drag in the IDLgrWindow control to rotate the globe and follow the instructions in the IDLitDirectWindow control to draw in the window. In the IDLitWindow, left-click on the surface and drag the mouse cursor to reposition the object, or left-click on one of the view handles and drag up or down to zoom in or out. The bottom label text will change when you move your mouse into or out of the IDLgrWindow- or IDLitDirectWindow-based controls as the label is updated with the NotifyBridge output from the IDL object definition